Hi there,
the attached patch solves a problem which occurs with ajax paging of views when the same view is represented more than once in Drupal.settings.views.ajaxViews. I know this is a rare occurrence but it happens with the new ajax version of my Quick Tabs module (the 6.x-2.x branch) because you can have two tabs, each containing an instance of the same view but with different arguments. You can see an example of what I mean here.
The patch simply puts a conditional around the line where the viewData variable (which will be the parameters sent with the ajax call to fetch the view) is populated from the settings - so that this only happens when the information about the view has not been retrieved from the querystring. Without the patch, the pager links on the second instance of the view, though their href contains the right data, result in the view being retrieved based on the settings for the first instance of that view_name within Drupal.settings.views.ajaxViews - which in the case of my example has different view_args.
I hope my explanation makes sense. I've tested ajax paged and filtered views outside of Quick Tabs with the patch and have noticed no side effects.
regards,
Katherine
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ajax_view_table_sort.patch | 855 bytes | katbailey |
| ajax_views_paging.patch | 857 bytes | katbailey |
Comments
Comment #1
merlinofchaos commentedLooks ok. Committed.
Comment #2
katbailey commentedSorry - I had forgotten about the table sort links, which needed the same treatment. Attached patch does the exact same thing a few lines down...
Comment #3
pasquallethis patch works. there is a remaining problem with exposed filters
the related issue: #345525: problems with ajax views inside ajax quicktabs (pagination)
Comment #4
merlinofchaos commentedHmm, patch fails to apply. I think Nedjo's ajax fixes I committed earlier may have interfered with this.
Comment #5
katbailey commentedAh yes, Nedjo's changes do indeed conflict with this. Ok, I'll need to re-think how to do this, maybe even discuss it with Nedjo to see if we can come up with a general solution for loading Views via ajax.
Comment #6
katbailey commentedWoah - actually I think Nedjo's changes eliminate the need for any patch from me. I thought it conflicted at first because some weird stuff was happening (behaviours not getting attached) but I think it must have been just a caching thing, and possibly I hadn't updated all the files. Have since tested with views HEAD and it's all working very smoothly indeed. Go Nedjo!! :-)
Comment #8
x_tra06 commentedthis path not working on the views 2.16 version? fix please?